<div class="container-fluid" style="margin-top: 10px;">
    <div class="row">
        <form id="buildingAlterForm" action="editBuildingAlter" method="post">
            <input hidden name="ALTER_NO" value="{$data.ALTER_NO}">
            {:form('text',['title'=>'变动单号','value'=>$data.ALTER_NO,'disable'=>'disabled'])}
            {:form('select',['title'=>'变动构筑物','name'=>'BUILDING_NO','disable'=>'disabled','value'=>$data.BUILDING_NO,'list'=>$buildingList,'key'=>'BUILDING_NO','field'=>'BUILDING_NAME'])}
            {:form('select',['title'=>'所属学院','name'=>'COLLEGE_ID','disable'=>'disabled','value'=>$data.COLLEGE_ID,'list'=>$collegeList,'key'=>'COLLEGE_ID','field'=>'COLLEGE'])}
            {:form('text',['title'=>'大楼房间号','name'=>'ROOM_NO','disable'=>'disabled','value'=>$data.ROOM_NO])}
            {:line()}
            {:form('text',['title'=>'变动类型','value'=>$data.ALTERTYPE,'disable'=>'disabled'])}
            {:form('date',['title'=>'开始日期','name'=>'ALTER_DATE','value'=>$data.ALTER_DATE])}
            {:form('date',['title'=>'结束日期','name'=>'STOP_DATE','value'=>$data.STOP_DATE])}
            {:line()}
            {:form('text',['title'=>'批准单位','name'=>'PASS_DEPART','value'=>$data.PASS_DEPART])}
            {:form('text',['title'=>'批准文号','name'=>'PASS_NO','value'=>$data.PASS_NO])}
            {:form('text',['title'=>'批准人','name'=>'PASS_PERSON','value'=>$data.PASS_PERSON])}

            {:form('text',['title'=>'合同号','name'=>'CONTRACT_NO','value'=>$data.CONTRACT_NO])}
            {:form('text',['title'=>'主管部门','name'=>'ACCEPT_HEAD_DEPART','value'=>$data.ACCEPT_HEAD_DEPART])}
            {:form('text',['title'=>'经办人','name'=>'WORK_PERSON','value'=>$data.WORK_PERSON])}

            {if $data.ALTERTYPE_ID == '51'}
            {:form('text',['title'=>'承租单位','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {:form('text',['title'=>'出租面积','name'=>'RELEVANT_SIZE','value'=>$data.RELEVANT_SIZE])}
            {:form('text',['title'=>'合同金额','name'=>'ALL_FEE','value'=>$data.ALL_FEE])}
            {/if}
            {if $data.ALTERTYPE_ID == '52'}
            {:form('text',['title'=>'借用单位','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {:form('text',['title'=>'出借面积','name'=>'RELEVANT_SIZE','value'=>$data.RELEVANT_SIZE])}
            {:form('text',['title'=>'出借收益','name'=>'ALL_FEE','value'=>$data.ALL_FEE])}
            {/if}
            {if $data.ALTERTYPE_ID == '53'}
            {:form('text',['title'=>'被投资方','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {:form('text',['title'=>'投资面积','name'=>'RELEVANT_SIZE','value'=>$data.RELEVANT_SIZE])}
            {:form('text',['title'=>'计总收益','name'=>'ALL_FEE','value'=>$data.ALL_FEE])}
            {:form('text',['title'=>'股权比例','name'=>'EQUITY_PERCENT','value'=>$data.EQUITY_PERCENT])}
            {:form('text',['title'=>'年均收益','name'=>'YEAR_FEE','value'=>$data.YEAR_FEE])}
            {:form('text',['title'=>'投资年限','name'=>'YEAR_NUM','value'=>$data.YEAR_NUM])}
            {/if}
            {if $data.ALTERTYPE_ID == '54'}
            {:form('text',['title'=>'调拨单位','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {/if}
            {if $data.ALTERTYPE_ID == '55'}
            {:form('text',['title'=>'转让单位','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {:form('text',['title'=>'转让面积','name'=>'RELEVANT_SIZE','value'=>$data.RELEVANT_SIZE])}
            {:form('text',['title'=>'处置收益','name'=>'ALL_FEE','value'=>$data.ALL_FEE])}
            {/if}
            {if $data.ALTERTYPE_ID == '56'}
            {:form('text',['title'=>'对方单位','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {:form('text',['title'=>'置换收益','name'=>'ALL_FEE','value'=>$data.ALL_FEE])}
            {/if}
            {if $data.ALTERTYPE_ID == '57'}
            {:form('text',['title'=>'相关单位','name'=>'RELEVANT_DEPART','value'=>$data.RELEVANT_DEPART])}
            {:form('text',['title'=>'处置收益','name'=>'ALL_FEE','value'=>$data.ALL_FEE])}
            {/if}

            {:form('text',['title'=>'备注','name'=>'REMARK','value'=>$data.REMARK,'col'=>'col-sm-12'])}
            {:line()}
            {:form('text',['title'=>'制单人','disable'=>'disabled','value'=>$data.USER_NAME])}
            {:form('text',['title'=>'制单时间','disable'=>'disabled','value'=>$data.OPER_DATE])}
            <div class="col-sm-12" style="margin-top: 10px;text-align: center">
                <button id="addButton" class="btn btn-info" type="button">保存</button>
                <button class="btn btn-default" type="reset">重置</button>
            </div>
        </form>
    </div>
</div>

<script>

    $(function () {

        $("#addButton").on('click',function () {
            layer.confirm('确认修改变动吗？',{icon:3},function (index) {
                layer.close(index);
                ajaxSubmit($("#buildingAlterForm"),function (data) {
                    parent.refreshTable();
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                });
            });
        });

    });

</script>